package cn.org.eshow.webapp.action.response;


import cn.org.eshow.model.Coupon;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 优惠券返回对象
 */
public class CouponResponse {

    public Integer id = 0;//代金券ID
    public Date addTime = new Date();//添加时间
    public Date startTime = new Date();//开始时间
    public Date endTime = new Date();//结束时间
    public String title;//标题
    public Double money = 0.0;//价格
    public Double requirement = 0.0;//使用条件（订单满多少分才能用这个代金券，单位元）
    public String scope;//使用范围（不限）
    public Integer total = 0;//总库存数
    public Integer stock = 0;//剩余可用库存数
    public Integer used = 0;//已使用数
    public Integer state = 0;//状态（0未审核,1已审核,-1审核驳回）
    public List<UserSimpleResponse> users = new ArrayList<UserSimpleResponse>();

    public CouponResponse() {
    }

    public CouponResponse(Coupon coupon) {
        this.id = coupon.getId();
        this.addTime = coupon.getAddTime();
        this.startTime = coupon.getStartTime();
        this.endTime = coupon.getEndTime();
        this.title = coupon.getTitle();
        this.money = coupon.getMoney();
        this.requirement = coupon.getRequirement();
        this.scope = coupon.getScope();
        this.total = coupon.getTotal();
        this.stock = coupon.getStock();
        this.used = coupon.getUsed();
        this.state = coupon.getState();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public Double getRequirement() {
        return requirement;
    }

    public void setRequirement(Double requirement) {
        this.requirement = requirement;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getUsed() {
        return used;
    }

    public void setUsed(Integer used) {
        this.used = used;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public List<UserSimpleResponse> getUsers() {
        return users;
    }

    public void setUsers(List<UserSimpleResponse> users) {
        this.users = users;
    }
}
